#ifndef SNCascadeBoostTrainData_h__
#define SNCascadeBoostTrainData_h__

#include "SNFeatureEvaluator.h"
#include "opencv2\ml\ml.hpp"

class SNCascadeBoostTrainData : public CvDTreeTrainData
{
public:
	SNCascadeBoostTrainData();
	~SNCascadeBoostTrainData();

	SNCascadeBoostTrainData(const SNFeatureEvaluator* feature_evaluator, const CvDTreeParams& params);
	SNCascadeBoostTrainData(const SNFeatureEvaluator* feature_evaluator,int num_samples, int precalc_val_buf_size, int precalc_idx_buf_size, const CvDTreeParams& _params = CvDTreeParams());
	/*virtual void SetData(const SNFeatureEvaluator* _featureEvaluator, int num_samples, int precalc_val_buf_size, int precalc_idx_buf_size, const CvDTreeParams& _params = CvDTreeParams());
	void Precalculate();

	virtual CvDTreeNode* SubsampleData(const CvMat* subsample_idx);

	virtual const int* GetClassLabels(CvDTreeNode* n, int* labels_buf);
	virtual const int* GetCVLabels (CvDTreeNode* n, int* labels_buf);
	virtual const int* GetSampleIndices(CvDTreeNode* n, int* indicesBuf);

	virtual void GetOrdVarData(CvDTreeNode* n, int vi, float* ord_values_buf, int* sorted_indices_buf, const float** ord_values, const int** sorted_indices, int* sample_indices_buf);
	virtual const int* GetCatVarData(CvDTreeNode* n, int vi, int* catValuesBuf);
	virtual float GetVarValue(int vi, int si);
	virtual void FreeTrainData();*/

	const SNFeatureEvaluator* FeatureEvaluator;
	cv::Mat ValCache; // precalculated feature values (CV_32FC1)
	CvMat Resp; // for casting
	int NumPrecalcVal;
	int NumPrecalcIdx;

	static const int MinBlockSize = 1 << 16;
	static const int BlockSizeDelta = 1 << 10;
};


#endif // SNCascadeBoostTrainData_h__

